package com.ymatou.iapi.godmch.service;

import org.json.JSONException;

import com.google.gson.Gson;
import com.google.gson.reflect.TypeToken;
import com.ymt.base.YmatouBaseCall;
import com.ymttest.database.model.godmch.mch_config;
import com.ymttest.utils.EnvSetup;
/**
*商户配置信息Call
*FreeMaker Template自动生成代码
*/
public class getMchConfigCall extends YmatouBaseCall{
	private static String opurl ="api/mch/getMchConfig";
	
	public getMchConfigCall() {
		super(EnvSetup.getSystemUrl("godmch_iapi"),opurl,"POST","JSON");
	}
	@Override
	public void addDefHeader() {
		client.addHeader("Accept","text/xml,text/javascript,text/html,application/json");
		client.addHeader("Content-Type", "application/json; charset=UTF-8");
	}
	
	
	 public String getStatusCode1()
		{
		  return getString("status");
		}
		
		 public String getMessage()
		{
		 return getString("msg");
		}
		
		public mch_config getResult() throws JSONException
		{
			mch_config info=new mch_config();
		  try{
			 info = (mch_config) new Gson().fromJson(getJsonObject().get("result").toString(), new TypeToken<mch_config>() {}.getType());
		} catch (Exception e) {
		}
		  return info;
		}
}